{% extends 'common/basic_list.html' %}

{% block list_title %}
    业务
{% endblock %}

{% block list_filter %}
    <div class="col-sm-3">
        <div class="input-group">
            <input type="text" name="name" placeholder="业务名称"
                   value="{{ name }}"
                   class="input-sm form-control">

        </div>
    </div>
    <div class="col-sm-6">
        <div class="input-group">
            &nbsp;
            <button type="submit" class="btn btn-sm btn-primary"><i class="fa fa-search"></i> 搜索</button>
            &nbsp;
            <a href="project_add/"
               class="btn btn-sm btn-success"><i class="fa fa-plus"></i> 新增</a>
            &nbsp;
{#            <a href="javascript:void(0)"#}
{#               onclick="scan_state()"#}
{#               class="btn btn-sm btn-info"><i class="fa fa-plus"></i> 状态更新</a>#}
            &nbsp;
            <a href="javascript:void(0)"
               onclick="deleteBatch()"
               class="btn btn-sm btn-danger"><i class="fa fa-trash"></i> 批量删除</a>
        </div>
        <script>
            function scan_state() {
                layer.load();
                $.get('scan_state/', function () {
                    location.reload()
                    layer.closeAll('loading');
                })

            }
        </script>
    </div>
{% endblock %}

{% block list_content %}
    <table class="table table-striped table-bordered table-hover dataTables-example dataTable">
        <thead>
        <tr>
            <th style="width: 2%;"><input id="checkall" type="checkbox" class="i-checks"></th>
            <th style="width: 7%;">
                <a class="order-by-column" data-column="project_module" href="#">
                    <i class="fa fa-sort order-by-column_icon"></i>
                    业务模块
                </a>
            </th>
            <th style="width: 5%;">
                <a class="order-by-column" data-column="name" href="#">
                    <i class="fa fa-sort order-by-column_icon"></i>
                    名称
                </a>
            </th>
            <th style="width: 5%;">
                <a class="order-by-column" data-column="dev_monitor" href="#">
                    <i class="fa fa-sort order-by-column_icon"></i>
                    开发负责人
                </a>
            </th>
            <th style="width: 5%;">
                <a class="order-by-column" data-column="ops_monitor" href="#">
                    <i class="fa fa-sort order-by-column_icon"></i>
                    运维负责人
                </a>
            </th>
            <th style="width: 7%;">
                <a class="order-by-column" data-column="create_time" href="#">
                    <i class="fa fa-sort order-by-column_icon"></i>
                    创建时间
                </a>
            </th>
            <th style="width:20%;">操作</th>
        </tr>
        </thead>
        <tbody>
        {% for o in result_list %}
            <tr>
                <td>
                    <input type="checkbox" class="i-checks icheck" id="{{ o.id }}" name="input[]">
                </td>
                <td>{{ o.project_module|parent_filter }}</td>
                <td>{{ o.name }}</td>
                <td>{{ o.dev_monitor|parent_filter }}</td>
                <td>{{ o.ops_monitor|parent_filter }}</td>

                <td>{{ o.create_time }}</td>
                <td>
                    {#                    <a href="{{ o.id }}/project_edit/"#}
                    {#                       class="btn  btn-sm btn-success"><i class="fa fa-edit"></i>配置</a>#}
                    <a href="{{ o.id }}/project_edit/"
                       class="btn  btn-sm btn-info"><i class="fa fa-edit"></i>编辑</a>
                    <a href="project_version/?pk={{ o.id }}"
                       class="btn  btn-sm btn-success"><i class="fa fa-edit"></i>版本</a>
                    <a href="project_deploy/?pk={{ o.id }}"
                       class="btn  btn-sm btn-info"><i class="fa fa-edit"></i>部署</a>
                    <a href="project_deploy_history/?pk={{ o.id }}"
                       class="btn  btn-sm btn-success"><i class="fa fa-expand"></i>历史</a>
                    <a href="javascript:void(0)"
                       onclick="deleteAction('{{ o.id }}')"
                       class="btn  btn-sm btn-danger"><i class="fa fa-trash"></i>删除</a>
                </td>
            </tr>
        {% endfor %}
        </tbody>
    </table>
{% endblock %}